﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace LXD.StudnetMangement.Models
{
    //学生模式
    public class Student
    {
        public int ID { get; set; }
        [Display(Name= "姓名")]
        [Required(ErrorMessage ="请输入名字")]
        [MaxLength(50, ErrorMessage = "名字的长度不能超过50个字符")]
        public string Name { get; set; }

        [Display(Name = "班级信息")]
        [Required(ErrorMessage = "请输入班级信息")]
        public ClassNameEnum? ClassName { get; set; }

        [Display(Name = "邮箱地址")]
        [Required(ErrorMessage = "请输入邮箱地址")]
        [RegularExpression(@"[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?",ErrorMessage ="邮箱格式不正确")]
        public string Email { get; set; }

        public string Major { get; set; }

        public string PhotoPath { get; set; }
    }
}
